package com.xr.miniprogram.controller.service;

import com.xr.common.core.controller.BaseController;
import com.xr.common.core.domain.AjaxResult;
import com.xr.miniprogram.domain.MiniProgramMenu;
import com.xr.miniprogram.domain.vo.MiniProgramMenuTree;
import com.xr.miniprogram.service.IMiniProgramMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api("小程序服务菜单控制")
@RestController
@RequestMapping("/miniprogram/menu")
public class MiniProgramMenuController extends BaseController {
    @Resource
    private IMiniProgramMenuService menuService;


    /**
     * 查询服务菜单树形结构
     * @return
     */
    @ApiOperation("获取服务菜单树形结构")
    @GetMapping("/tree")
    public AjaxResult tree(){
        List<MiniProgramMenuTree> list= menuService.getMenuTreeList();
        return success(list);
    }
}
